package com.devinlee.designpatterns.observer.consumer;

import com.devinlee.designpatterns.observer.Goods;

/**
 * 观察者模式-顾客
 * <p>
 * Created by devinlee in 2022.07.04
 */
public class Customer implements MessageListent {

    private String name;

    public Customer(String name) {
        this.name = name;
    }

    @Override
    public void receive(String messageType, Goods goods) {
        System.out.println(String.format("顾客[%s]收到了商品[%s]的[%s]活动！", name, goods.getName(), messageType));
    }
}
